package com.ct.ah.lab.controller;

import com.ct.ah.lab.entity.Announcement;
import com.ct.ah.lab.entity.User;
import com.ct.ah.lab.exception.UserException;
import com.ct.ah.lab.service.IAnnouncemenService;
import com.ct.ah.lab.service.IUserService;
import com.wf.captcha.utils.CaptchaUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.*;
import java.util.Base64.Decoder;

@Controller
@RequestMapping("/announcement")
public class AnnouncementController {
    @Autowired
    private IAnnouncemenService AnnouncemenService;

//    @RequestMapping("/hello")
//    @ResponseBody
//    public String hello() {
//        return "hello";
//    }

    @RequestMapping("/list")
    @ResponseBody
    public List<Announcement> list(Integer num) {
        return AnnouncemenService.list(num);
    }
}
